home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
likene1a
/
myprog10.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1999-09-24
|
5KB
|
157 lines
VERSION 5.00
Begin VB.Form frmmain
BorderStyle = 3 'Fixed Dialog
Caption = "Miscellaneous"
ClientHeight = 1080
ClientLeft = 4515
ClientTop = 3615
ClientWidth = 3120
ControlBox = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form5"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1080
ScaleWidth = 3120
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command1
Caption = "Play sound"
Height = 375
Left = 1560
TabIndex = 5
Top = 720
Width = 1575
End
Begin VB.CommandButton Command8
Caption = "Msg manager"
Height = 375
Left = 0
TabIndex = 3
Top = 720
Width = 1575
End
Begin VB.CommandButton command10
BackColor = &H00C0C0C0&
Caption = "Play CD"
Height = 375
Left = 1560
TabIndex = 2
Top = 360
Width = 1575
End
Begin VB.CommandButton Command5
BackColor = &H00C0C0C0&
Caption = "Show image"
Height = 375
Left = 0
TabIndex = 1
Top = 360
Width = 1575
End
Begin VB.CommandButton Command4
BackColor = &H00C0C0C0&
Caption = "Open CD-ROM"
Height = 375
Left = 1560
TabIndex = 0
Top = 0
Width = 1575
End
Begin VB.CommandButton Command25
Caption = "Exit"
Height = 375
Left = 0
TabIndex = 4
Top = 0
Width = 1575
End
Attribute VB_Name = "frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mmflag As Boolean
Dim sax As Integer
Dim Say As Integer
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As String, ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, _
ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
Form7.Show
End Sub
Private Sub command10_Click()
PopupMenu Frmmenu.mnuFile, 0, frmmain.ScaleWidth / 2, frmmain.ScaleHeight / 2
End Sub
Private Sub Command25_Click()
Call ImplodeForm(Me, 2, 500, 1)
Unload frmmain
Form12.Show
End Sub
Private Sub Command4_Click()
If Command4.Caption = "Open CD-ROM" Then
Command4.Caption = "Close CD-ROM"
Command4.Caption = "Open CD-ROM"
End If
If Command4.Caption = "Close CD-ROM" Then
retvalue = mciSendString("set CDAudio door open", _
returnstring, 127, 0)
End If
If Command4.Caption = "Open CD-ROM" Then
retvalue = mciSendString("set CDAudio door closed", _
returnstring, 127, 0)
End If
End Sub
Private Sub Command5_Click()
MsgBox "Only open .bmp files ok?", 64 + 0, "Info"
Form8.Show
End Sub
Private Sub Command8_Click()
Load Form3
Form3.Show
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim fml As Long
Dim fmt As Long
Dim a As Integer
If mmflag = True Then
fml = Me.Left: fmt = Me.Top
If X > sax Then Me.Left = fml + (X - sax)
If X < sax Then Me.Left = fml - (sax - X)
If Y > Say Then Me.Top = fmt + (Y - Say)
If Y < Say Then Me.Top = fmt - (Say - Y)
End If
End Sub
Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If mmflag = False Then
sax = X
Say = Y
mmflag = True
End If
Me.MousePointer = vbSizePointer
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
mmflag = False
Me.MousePointer = vbDefault
End Sub